package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {
	var myguessNum int
	guessTimes := 0
	rand.Seed(time.Now().Unix())
	randNum := rand.Intn(100) +1
	fmt.Println(randNum)
	fmt.Println("程序随机生成 1-100 的数字，答对有奖励哦！！")
	for {
		guessTimes ++
		fmt.Println("请输入 1-100 的数字：")
		fmt.Scan(&myguessNum)
		if myguessNum == randNum {
			fmt.Println("恭喜你答对啦")
			break
		}
		if guessTimes >= 10 {
			fmt.Println("一次都没猜对哦")
			break
		}
	}


}